Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error "E1502: Lua failed to grow stack to 4001" #1075

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

shanesmith
Copy link
Contributor

@shanesmith shanesmith commented Jun 23, 2024

The neoVimBuffer function was updated in #1015 to used a lua script through nvimExecLua. The script returns the dictionary retrieved from the getbufinfo vim functions. The issue is that this can grow very large, especially the variables entry, and can cause the lua stack to grow too big and error.

In the end the neoVimBuffer function only needs a small handful of the entries from getbufinfo, and so the lua script has been updated to return a dictionary with only those entries.

At the same time the hasDirtyBuffers function was found to also return the getbufinfo dictionary and was similarly fixed. It was also noticed that the argument passed into getbuinfo here was a vim style dictionary and not valid lua. This made hasDirtyBuffers fail and caused an issue in MainWindow.windowShouldClose where selecting `File

Close Window` would close the window even when dirty buffers were
present. The proper lua dictionary syntax is now used and fixes this issues.

Fixes #1044

The `neoVimBuffer` function was updated in qvacua#1015 to used a lua script
through `nvimExecLua`. The script returns the dictionary retrieved from
the `getbufinfo` vim functions. The issue is that this can grow very
large, especially the `variables` entry, and can cause the lua stack to
grow too big and error.

In the end the `neoVimBuffer` function only needs a small handful of the
entries from `getbufinfo`, and so the lua script has been updated to
return a dictionary with only those entries.

At the same time the `hasDirtyBuffers` function was found to also return
the `getbufinfo` dictionary and was similarly fixed. It was also noticed
that the argument passed into `getbuinfo` here was a vim style
dictionary and not valid lua. This made `hasDirtyBuffers` fail and
caused an issue in `MainWindow.windowShouldClose` where selecting `File
> Close Window` would close the window even when dirty buffers were
present. The proper lua dictionary syntax is now used and fixes this
issues.

Fixes qvacua#1044
@georgeharker
Copy link
Collaborator

Awesome. Thank you!

@qvacua qvacua merged commit 33d55d3 into qvacua:master Jun 26, 2024
@qvacua
Copy link
Owner

qvacua commented Jun 26, 2024

Thank you!

@p8
Copy link

p8 commented Jun 28, 2024

Thanks @shanesmith !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E1502: Lua failed to grow stack to 4001
4 participants